xen: Rename remaining vcpu_flags as pause_flags.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 29 Mar 2007 17:26:12 +0000 (18:26 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 29 Mar 2007 17:26:12 +0000 (18:26 +0100)
Signed-off-by: Keir Fraser <keir@xensource.com>
26 files changed:
xen/arch/ia64/vmx/vlsapic.c
xen/arch/ia64/vmx/vmx_support.c
xen/arch/ia64/xen/domain.c
xen/arch/ia64/xen/fw_emul.c
xen/arch/ia64/xen/hypercall.c
xen/arch/powerpc/domain.c
xen/arch/powerpc/domain_build.c
xen/arch/x86/domain.c
xen/arch/x86/domain_build.c
xen/arch/x86/domctl.c
xen/arch/x86/hvm/hvm.c
xen/arch/x86/hvm/save.c
xen/arch/x86/hvm/vpt.c
xen/arch/x86/x86_32/asm-offsets.c
xen/arch/x86/x86_64/asm-offsets.c
xen/common/domain.c
xen/common/domctl.c
xen/common/event_channel.c
xen/common/keyhandler.c
xen/common/sched_credit.c
xen/common/schedule.c
xen/include/asm-ia64/event.h
xen/include/asm-powerpc/event.h
xen/include/asm-x86/event.h
xen/include/xen/event.h
xen/include/xen/sched.h

index e64a08f6a8d203b8b86e784dc21a6a70aa7b3dd7..b262a809c496b8cac805d6a066e9bf976eccb561 100644 (file)
@@ -693,7 +693,7 @@ static void vlsapic_write_ipi(VCPU *vcpu, uint64_t addr, uint64_t value)
         panic_domain(NULL, "Unknown IPI cpu\n");
 
     if (!targ->is_initialised ||
-        test_bit(_VCPUF_down, &targ->vcpu_flags)) {
+        test_bit(_VPF_down, &targ->pause_flags)) {
 
         struct pt_regs *targ_regs = vcpu_regs(targ);
         struct vcpu_guest_context c;
@@ -709,7 +709,7 @@ static void vlsapic_write_ipi(VCPU *vcpu, uint64_t addr, uint64_t value)
         targ_regs->cr_iip = d->arch.sal_data->boot_rdv_ip;
         targ_regs->r1 = d->arch.sal_data->boot_rdv_r1;
 
-        if (test_and_clear_bit(_VCPUF_down,&targ->vcpu_flags)) {
+        if (test_and_clear_bit(_VPF_down,&targ->pause_flags)) {
             vcpu_wake(targ);
             printk(XENLOG_DEBUG "arch_boot_vcpu: vcpu %d awaken %016lx!\n",
                    targ->vcpu_id, targ_regs->cr_iip);
index 3056500572b02cdecaaa9a2bdc64450a88eff529..e71dd991d4579a325735bd4acb053853142c959d 100644 (file)
@@ -82,12 +82,12 @@ void vmx_send_assist_req(struct vcpu *v)
             p->state != STATE_IOREQ_INPROCESS)
             break;
 
-        set_bit(_VCPUF_blocked_in_xen, &current->vcpu_flags);
+        set_bit(_VPF_blocked_in_xen, &current->pause_flags);
         mb(); /* set blocked status /then/ re-evaluate condition */
         if (p->state != STATE_IOREQ_READY &&
             p->state != STATE_IOREQ_INPROCESS)
         {
-            clear_bit(_VCPUF_blocked_in_xen, &current->vcpu_flags);
+            clear_bit(_VPF_blocked_in_xen, &current->pause_flags);
             break;
         }
 
index d7d3e67aa641c14d8ce527d1dc7f28f9541d5d67..3a1d94b13a03210978f7c6e35984cc010dac878f 100644 (file)
@@ -680,7 +680,7 @@ int arch_set_info_guest(struct vcpu *v, vcpu_guest_context_u c)
                v->is_initialised = 1;
                /* Auto-online VCPU0 when it is initialised. */
                if (v->vcpu_id == 0)
-                       clear_bit(_VCPUF_down, &v->vcpu_flags);
+                       clear_bit(_VPF_down, &v->pause_flags);
        }
 
        return 0;
@@ -1191,7 +1191,7 @@ int construct_dom0(struct domain *d,
        printk("Dom0: 0x%lx\n", (u64)dom0);
 
        v->is_initialised = 1;
-       clear_bit(_VCPUF_down, &v->vcpu_flags);
+       clear_bit(_VPF_down, &v->pause_flags);
 
        /* Build firmware.
           Note: Linux kernel reserve memory used by start_info, so there is
index bacbfae5102ce1234cb2d0af907b8fa39469cd21..0cca1a4e3507d892726375f1a4514c1776b1ff3c 100644 (file)
@@ -374,7 +374,7 @@ sal_emulator (long index, unsigned long in1, unsigned long in2,
                printk("*** CALLED SAL_UPDATE_PAL.  IGNORED...\n");
                break;
            case SAL_XEN_SAL_RETURN:
-               if (!test_and_set_bit(_VCPUF_down, &current->vcpu_flags))
+               if (!test_and_set_bit(_VPF_down, &current->pause_flags))
                        vcpu_sleep_nosync(current);
                break;
            case SN_SAL_GET_MASTER_NASID:
@@ -725,7 +725,7 @@ xen_pal_emulator(unsigned long index, u64 in1, u64 in2, u64 in3)
                        console_start_sync();
                        (*efi.reset_system)(EFI_RESET_SHUTDOWN,0,0,NULL);
                } else {
-                       set_bit(_VCPUF_down, &current->vcpu_flags);
+                       set_bit(_VPF_down, &current->pause_flags);
                        vcpu_sleep_nosync(current);
                        status = PAL_STATUS_SUCCESS;
                }
index d3630ded83c8166f11415ca8c1e710eba870ccb1..e43a9ed5e9a898e923dcdf3dc8c4acc4aaaf4b67 100644 (file)
@@ -82,7 +82,7 @@ fw_hypercall_ipi (struct pt_regs *regs)
 
        if (vector == XEN_SAL_BOOT_RENDEZ_VEC
            && (!targ->is_initialised
-               || test_bit(_VCPUF_down, &targ->vcpu_flags))) {
+               || test_bit(_VPF_down, &targ->pause_flags))) {
 
                /* First start: initialize vpcu.  */
                if (!targ->is_initialised) {
@@ -102,8 +102,8 @@ fw_hypercall_ipi (struct pt_regs *regs)
                vcpu_regs (targ)->r1 = d->arch.sal_data->boot_rdv_r1;
                vcpu_regs (targ)->b0 = FW_HYPERCALL_SAL_RETURN_PADDR;
 
-               if (test_and_clear_bit(_VCPUF_down,
-                                      &targ->vcpu_flags)) {
+               if (test_and_clear_bit(_VPF_down,
+                                      &targ->pause_flags)) {
                        vcpu_wake(targ);
                        printk(XENLOG_INFO "arch_boot_vcpu: vcpu %d awaken\n",
                               targ->vcpu_id);
@@ -207,7 +207,7 @@ ia64_hypercall(struct pt_regs *regs)
                regs->r10 = x.r10; regs->r11 = x.r11;
                break;
        case FW_HYPERCALL_SAL_RETURN:
-               if ( !test_and_set_bit(_VCPUF_down, &v->vcpu_flags) )
+               if ( !test_and_set_bit(_VPF_down, &v->pause_flags) )
                        vcpu_sleep_nosync(v);
                break;
        case FW_HYPERCALL_EFI_CALL:
index e8e3c7805fc4c11e5a302f870888652e21d0b623..3ac88013ed0b35cb8105c2dd64343ec4e90e2814 100644 (file)
@@ -173,7 +173,7 @@ int arch_set_info_guest(struct vcpu *v, vcpu_guest_context_u c)
         v->is_initialised = 1;
         /* Auto-online VCPU0 when it is initialised. */
         if ( v->vcpu_id == 0 )
-            clear_bit(_VCPUF_down, &v->vcpu_flags);
+            clear_bit(_VPF_down, &v->pause_flags);
     }
 
     cpu_init_vcpu(v);
index e8ee2b01dd670bd15788dcc3beb4bb3893499c00..92e3c20217f9d2f717b260c500efd24b63cd63e2 100644 (file)
@@ -274,7 +274,7 @@ int construct_dom0(struct domain *d,
     ofd_dom0_fixup(d, *ofh_tree + rma, cmdline, shared_info_addr);
 
     v->is_initialised = 1;
-    clear_bit(_VCPUF_down, &v->vcpu_flags);
+    clear_bit(_VPF_down, &v->pause_flags);
 
     rc = 0;
 
index 8da2287a757b7edfe879c6eff254cf44ad0cd5e9..af43de2328f17cbe84a3e161eb0e22de946056a9 100644 (file)
@@ -706,9 +706,9 @@ int arch_set_info_guest(
 
  out:
     if ( flags & VGCF_online )
-        clear_bit(_VCPUF_down, &v->vcpu_flags);
+        clear_bit(_VPF_down, &v->pause_flags);
     else
-        set_bit(_VCPUF_down, &v->vcpu_flags);
+        set_bit(_VPF_down, &v->pause_flags);
     return 0;
 #undef c
 }
index 6cecf6b56f2cee2066737ce410328e07362ab209..31bdd20708692a2fd8ab7d337ef5f8abf20fc061 100644 (file)
@@ -902,7 +902,7 @@ int construct_dom0(struct domain *d,
     update_domain_wallclock_time(d);
 
     v->is_initialised = 1;
-    clear_bit(_VCPUF_down, &v->vcpu_flags);
+    clear_bit(_VPF_down, &v->pause_flags);
 
     /*
      * Initial register values:
index 9cf3825cd1d53f23f92d5ed6f05e31552ccc8d74..deb8c584d05c3d42aeecd6329720d0c1ef44dfff 100644 (file)
@@ -450,7 +450,7 @@ void arch_get_info_guest(struct vcpu *v, vcpu_guest_context_u c)
     c(flags &= ~(VGCF_i387_valid|VGCF_in_kernel));
     if ( v->fpu_initialised )
         c(flags |= VGCF_i387_valid);
-    if ( !test_bit(_VCPUF_down, &v->vcpu_flags) )
+    if ( !test_bit(_VPF_down, &v->pause_flags) )
         c(flags |= VGCF_online);
 
     if ( is_hvm_vcpu(v) )
index f521dafe50f40936409643a4da31b1478b76279c..d01935de823018c979851f91e4c969fca7ff6502 100644 (file)
@@ -238,7 +238,7 @@ static int hvm_save_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
     {
         /* We don't need to save state for a vcpu that is down; the restore 
          * code will leave it down if there is nothing saved. */
-        if ( test_bit(_VCPUF_down, &v->vcpu_flags) ) 
+        if ( test_bit(_VPF_down, &v->pause_flags) ) 
             continue;
 
         hvm_funcs.save_cpu_ctxt(v, &ctxt);
@@ -269,7 +269,7 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
         return -EINVAL;
 
     /* Auxiliary processors should be woken immediately. */
-    if ( test_and_clear_bit(_VCPUF_down, &v->vcpu_flags) )
+    if ( test_and_clear_bit(_VPF_down, &v->pause_flags) )
         vcpu_wake(v);
 
     return 0;
@@ -331,8 +331,8 @@ void hvm_vcpu_reset(struct vcpu *v)
 
     hvm_funcs.vcpu_initialise(v);
 
-    set_bit(_VCPUF_down, &v->vcpu_flags);
-    clear_bit(_VCPUF_blocked, &v->vcpu_flags);
+    set_bit(_VPF_down, &v->pause_flags);
+    clear_bit(_VPF_blocked, &v->pause_flags);
     v->fpu_initialised = 0;
     v->fpu_dirtied     = 0;
     v->is_initialised  = 0;
@@ -350,13 +350,13 @@ static void hvm_vcpu_down(void)
            d->domain_id, v->vcpu_id);
 
     /* Doesn't halt us immediately, but we'll never return to guest context. */
-    set_bit(_VCPUF_down, &v->vcpu_flags);
+    set_bit(_VPF_down, &v->pause_flags);
     vcpu_sleep_nosync(v);
 
     /* Any other VCPUs online? ... */
     LOCK_BIGLOCK(d);
     for_each_vcpu ( d, v )
-        if ( !test_bit(_VCPUF_down, &v->vcpu_flags) )
+        if ( !test_bit(_VPF_down, &v->pause_flags) )
             online_count++;
     UNLOCK_BIGLOCK(d);
 
@@ -734,7 +734,7 @@ int hvm_bringup_ap(int vcpuid, int trampoline_vector)
         goto out;
     }
 
-    if ( test_and_clear_bit(_VCPUF_down, &v->vcpu_flags) )
+    if ( test_and_clear_bit(_VPF_down, &v->pause_flags) )
         vcpu_wake(v);
     gdprintk(XENLOG_INFO, "AP %d bringup suceeded.\n", vcpuid);
 
index a19043c1755d115dc7e1aeb96feae3910b07adb6..c66096c8524eeee1d1dac3e71a0358c663e84ff8 100644 (file)
@@ -185,7 +185,7 @@ int hvm_load(struct domain *d, hvm_domain_context_t *h)
 
     /* Down all the vcpus: we only re-enable the ones that had state saved. */
     for_each_vcpu(d, v) 
-        if ( test_and_set_bit(_VCPUF_down, &v->vcpu_flags) )
+        if ( test_and_set_bit(_VPF_down, &v->pause_flags) )
             vcpu_sleep_nosync(v);
 
     while(1) {
index 626ad6ed44cb4adafbb6648cb4ddf81f5b35f642..9fc64d9b54b07043e4d0a24eccbcabd7cb16d16e 100644 (file)
@@ -49,7 +49,7 @@ void pt_freeze_time(struct vcpu *v)
     struct list_head *list;
     struct periodic_time *pt;
 
-    if ( test_bit(_VCPUF_blocked, &v->vcpu_flags) )
+    if ( test_bit(_VPF_blocked, &v->pause_flags) )
         return;
 
     v->arch.hvm_vcpu.guest_time = hvm_get_guest_time(v);
index 4405bdb749a7aaafb678136a9e752d40a8253887..d9f5c27369bf2e04bf218bfd9022363add07f536 100644 (file)
@@ -66,7 +66,6 @@ void __dummy__(void)
            arch.guest_context.kernel_sp);
     OFFSET(VCPU_guest_context_flags, struct vcpu, arch.guest_context.flags);
     OFFSET(VCPU_arch_guest_fpu_ctxt, struct vcpu, arch.guest_context.fpu_ctxt);
-    OFFSET(VCPU_flags, struct vcpu, vcpu_flags);
     OFFSET(VCPU_nmi_addr, struct vcpu, nmi_addr);
     OFFSET(VCPU_nmi_pending, struct vcpu, nmi_pending);
     OFFSET(VCPU_nmi_masked, struct vcpu, nmi_masked);
index 2c152b1da7c0ada1f9f2eb26161cd7ab36b11916..e64ccd9d074767edbc510c93723a7e58029c83c0 100644 (file)
@@ -75,7 +75,6 @@ void __dummy__(void)
     OFFSET(VCPU_kernel_ss, struct vcpu, arch.guest_context.kernel_ss);
     OFFSET(VCPU_guest_context_flags, struct vcpu, arch.guest_context.flags);
     OFFSET(VCPU_arch_guest_fpu_ctxt, struct vcpu, arch.guest_context.fpu_ctxt);
-    OFFSET(VCPU_flags, struct vcpu, vcpu_flags);
     OFFSET(VCPU_nmi_addr, struct vcpu, nmi_addr);
     OFFSET(VCPU_nmi_pending, struct vcpu, nmi_pending);
     OFFSET(VCPU_nmi_masked, struct vcpu, nmi_masked);
index 9f1648fed549acc3c54f54535277d6b0baf92ab7..57d3c5a0747324b707135f8b90c9977c955372ad 100644 (file)
@@ -101,7 +101,7 @@ struct vcpu *alloc_vcpu(
 
     if ( !is_idle_domain(d) )
     {
-        set_bit(_VCPUF_down, &v->vcpu_flags);
+        set_bit(_VPF_down, &v->pause_flags);
         v->vcpu_info = shared_info_addr(d, vcpu_info[vcpu_id]);
     }
 
@@ -481,7 +481,7 @@ int vcpu_reset(struct vcpu *v)
     if ( rc != 0 )
         goto out;
 
-    set_bit(_VCPUF_down, &v->vcpu_flags);
+    set_bit(_VPF_down, &v->pause_flags);
 
     v->fpu_initialised = 0;
     v->fpu_dirtied     = 0;
@@ -489,7 +489,7 @@ int vcpu_reset(struct vcpu *v)
     v->is_initialised  = 0;
     v->nmi_pending     = 0;
     v->nmi_masked      = 0;
-    clear_bit(_VCPUF_blocked, &v->vcpu_flags);
+    clear_bit(_VPF_blocked, &v->pause_flags);
 
  out:
     UNLOCK_BIGLOCK(v->domain);
@@ -537,18 +537,18 @@ long do_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE(void) arg)
         if ( !v->is_initialised )
             return -EINVAL;
 
-        if ( test_and_clear_bit(_VCPUF_down, &v->vcpu_flags) )
+        if ( test_and_clear_bit(_VPF_down, &v->pause_flags) )
             vcpu_wake(v);
 
         break;
 
     case VCPUOP_down:
-        if ( !test_and_set_bit(_VCPUF_down, &v->vcpu_flags) )
+        if ( !test_and_set_bit(_VPF_down, &v->pause_flags) )
             vcpu_sleep_nosync(v);
         break;
 
     case VCPUOP_is_up:
-        rc = !test_bit(_VCPUF_down, &v->vcpu_flags);
+        rc = !test_bit(_VPF_down, &v->pause_flags);
         break;
 
     case VCPUOP_get_runstate_info:
index 5d7e5d7f90bd86271bf289a5f93ca2b1a30c8254..01af47a008c6d6fe46ac5391ab82cf71d35d14b8 100644 (file)
@@ -101,9 +101,9 @@ void getdomaininfo(struct domain *d, struct xen_domctl_getdomaininfo *info)
         vcpu_runstate_get(v, &runstate);
         cpu_time += runstate.time[RUNSTATE_running];
         info->max_vcpu_id = v->vcpu_id;
-        if ( !test_bit(_VCPUF_down, &v->vcpu_flags) )
+        if ( !test_bit(_VPF_down, &v->pause_flags) )
         {
-            if ( !(v->vcpu_flags & VCPUF_blocked) )
+            if ( !(v->pause_flags & VPF_blocked) )
                 flags &= ~XEN_DOMINF_blocked;
             if ( v->is_running )
                 flags |= XEN_DOMINF_running;
@@ -145,7 +145,7 @@ static unsigned int default_vcpu0_location(void)
     rcu_read_lock(&domlist_read_lock);
     for_each_domain ( d )
         for_each_vcpu ( d, v )
-        if ( !test_bit(_VCPUF_down, &v->vcpu_flags) )
+        if ( !test_bit(_VPF_down, &v->pause_flags) )
             cnt[v->processor]++;
     rcu_read_unlock(&domlist_read_lock);
 
@@ -574,8 +574,8 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domctl_t) u_domctl)
 
         vcpu_runstate_get(v, &runstate);
 
-        op->u.getvcpuinfo.online   = !test_bit(_VCPUF_down, &v->vcpu_flags);
-        op->u.getvcpuinfo.blocked  = test_bit(_VCPUF_blocked, &v->vcpu_flags);
+        op->u.getvcpuinfo.online   = !test_bit(_VPF_down, &v->pause_flags);
+        op->u.getvcpuinfo.blocked  = test_bit(_VPF_blocked, &v->pause_flags);
         op->u.getvcpuinfo.running  = v->is_running;
         op->u.getvcpuinfo.cpu_time = runstate.time[RUNSTATE_running];
         op->u.getvcpuinfo.cpu      = v->processor;
index 0db68de41a8004510f302059c8f0d140a0058128..c809c548b6c48cd5835ae9f606b5e869af6208c1 100644 (file)
@@ -481,8 +481,8 @@ long evtchn_send(unsigned int lport)
         if ( rchn->consumer_is_xen )
         {
             /* Xen consumers need notification only if they are blocked. */
-            if ( test_and_clear_bit(_VCPUF_blocked_in_xen,
-                                    &rvcpu->vcpu_flags) )
+            if ( test_and_clear_bit(_VPF_blocked_in_xen,
+                                    &rvcpu->pause_flags) )
                 vcpu_wake(rvcpu);
         }
         else
index 838c1222a496cb17992b70802865dbebdf6b23ac..07658e0de000601f08c938adf686f79869d84e27 100644 (file)
@@ -189,7 +189,7 @@ static void dump_domains(unsigned char key)
                    "upcall_pend = %02x, upcall_mask = %02x ",
                    v->vcpu_id, v->processor,
                    v->is_running ? 'T':'F',
-                   v->vcpu_flags,
+                   v->pause_flags,
                    vcpu_info(v, evtchn_upcall_pending),
                    vcpu_info(v, evtchn_upcall_mask));
             cpuset_print(tmpstr, sizeof(tmpstr), v->vcpu_dirty_cpumask);
index 6bc79cf0a4d86593869508437711cd6ecb6699c2..152da1248e83b23c53ad6d7cefaf0e6ddb34a784 100644 (file)
@@ -565,7 +565,7 @@ csched_vcpu_acct(unsigned int cpu)
     {
         CSCHED_VCPU_STAT_CRANK(svc, migrate_r);
         CSCHED_STAT_CRANK(migrate_running);
-        set_bit(_VCPUF_migrating, &current->vcpu_flags);
+        set_bit(_VPF_migrating, &current->pause_flags);
         cpu_raise_softirq(cpu, SCHEDULE_SOFTIRQ);
     }
 }
index 93c15d151a3051eb9652592404488992238c8400..12b3dfd06c6de7ead93ace51df791065a57fdfbf 100644 (file)
@@ -190,7 +190,7 @@ void vcpu_wake(struct vcpu *v)
             vcpu_runstate_change(v, RUNSTATE_runnable, NOW());
         SCHED_OP(wake, v);
     }
-    else if ( !test_bit(_VCPUF_blocked, &v->vcpu_flags) )
+    else if ( !test_bit(_VPF_blocked, &v->pause_flags) )
     {
         if ( v->runstate.state == RUNSTATE_blocked )
             vcpu_runstate_change(v, RUNSTATE_offline, NOW());
@@ -214,7 +214,7 @@ static void vcpu_migrate(struct vcpu *v)
      * regions are strictly serialised.
      */
     if ( v->is_running ||
-         !test_and_clear_bit(_VCPUF_migrating, &v->vcpu_flags) )
+         !test_and_clear_bit(_VPF_migrating, &v->pause_flags) )
     {
         vcpu_schedule_unlock_irqrestore(v, flags);
         return;
@@ -240,10 +240,10 @@ void vcpu_force_reschedule(struct vcpu *v)
 {
     vcpu_schedule_lock_irq(v);
     if ( v->is_running )
-        set_bit(_VCPUF_migrating, &v->vcpu_flags);
+        set_bit(_VPF_migrating, &v->pause_flags);
     vcpu_schedule_unlock_irq(v);
 
-    if ( test_bit(_VCPUF_migrating, &v->vcpu_flags) )
+    if ( test_bit(_VPF_migrating, &v->pause_flags) )
     {
         vcpu_sleep_nosync(v);
         vcpu_migrate(v);
@@ -265,11 +265,11 @@ int vcpu_set_affinity(struct vcpu *v, cpumask_t *affinity)
 
     v->cpu_affinity = *affinity;
     if ( !cpu_isset(v->processor, v->cpu_affinity) )
-        set_bit(_VCPUF_migrating, &v->vcpu_flags);
+        set_bit(_VPF_migrating, &v->pause_flags);
 
     vcpu_schedule_unlock_irq(v);
 
-    if ( test_bit(_VCPUF_migrating, &v->vcpu_flags) )
+    if ( test_bit(_VPF_migrating, &v->pause_flags) )
     {
         vcpu_sleep_nosync(v);
         vcpu_migrate(v);
@@ -284,12 +284,12 @@ static long do_block(void)
     struct vcpu *v = current;
 
     local_event_delivery_enable();
-    set_bit(_VCPUF_blocked, &v->vcpu_flags);
+    set_bit(_VPF_blocked, &v->pause_flags);
 
     /* Check for events /after/ blocking: avoids wakeup waiting race. */
     if ( local_events_need_delivery() )
     {
-        clear_bit(_VCPUF_blocked, &v->vcpu_flags);
+        clear_bit(_VPF_blocked, &v->pause_flags);
     }
     else
     {
@@ -315,7 +315,7 @@ static long do_poll(struct sched_poll *sched_poll)
     if ( !guest_handle_okay(sched_poll->ports, sched_poll->nr_ports) )
         return -EFAULT;
 
-    set_bit(_VCPUF_blocked, &v->vcpu_flags);
+    set_bit(_VPF_blocked, &v->pause_flags);
     v->is_polling = 1;
     d->is_polling = 1;
 
@@ -347,7 +347,7 @@ static long do_poll(struct sched_poll *sched_poll)
 
  out:
     v->is_polling = 0;
-    clear_bit(_VCPUF_blocked, &v->vcpu_flags);
+    clear_bit(_VPF_blocked, &v->pause_flags);
     return rc;
 }
 
@@ -648,7 +648,7 @@ static void schedule(void)
     ASSERT(prev->runstate.state == RUNSTATE_running);
     vcpu_runstate_change(
         prev,
-        (test_bit(_VCPUF_blocked, &prev->vcpu_flags) ? RUNSTATE_blocked :
+        (test_bit(_VPF_blocked, &prev->pause_flags) ? RUNSTATE_blocked :
          (vcpu_runnable(prev) ? RUNSTATE_runnable : RUNSTATE_offline)),
         now);
 
@@ -685,7 +685,7 @@ void context_saved(struct vcpu *prev)
     /* Check for migration request /after/ clearing running flag. */
     smp_mb();
 
-    if ( unlikely(test_bit(_VCPUF_migrating, &prev->vcpu_flags)) )
+    if ( unlikely(test_bit(_VPF_migrating, &prev->pause_flags)) )
         vcpu_migrate(prev);
 }
 
index 92cdddac794a0a54c6dd9b184eb12ade1bd6cf5d..c99babd97e05cde431bfa8e07674de40aaa120e3 100644 (file)
@@ -15,7 +15,7 @@
 static inline void vcpu_kick(struct vcpu *v)
 {
     /*
-     * NB1. 'vcpu_flags' and 'processor' must be checked /after/ update of
+     * NB1. 'pause_flags' and 'processor' must be checked /after/ update of
      * pending flag. These values may fluctuate (after all, we hold no
      * locks) but the key insight is that each change will cause
      * evtchn_upcall_pending to be polled.
index 9f10ee98baf32b4a5a08ac5ff890e505e9f4ff52..5c6d287b3ceab0f582945ef7347791ca22e504cb 100644 (file)
@@ -68,7 +68,7 @@ static inline int arch_virq_is_global(int virq)
 static inline void vcpu_kick(struct vcpu *v)
 {
     /*
-     * NB1. 'vcpu_flags' and 'processor' must be checked /after/ update of
+     * NB1. 'pause_flags' and 'processor' must be checked /after/ update of
      * pending flag. These values may fluctuate (after all, we hold no
      * locks) but the key insight is that each change will cause
      * evtchn_upcall_pending to be polled.
index 922ede6fc61f7aa31d6dd741556dc9648decad2c..09440bcc4a5526b0ecf3fa6b68b22804745d0486 100644 (file)
@@ -15,7 +15,7 @@
 static inline void vcpu_kick(struct vcpu *v)
 {
     /*
-     * NB1. 'vcpu_flags' and 'processor' must be checked /after/ update of
+     * NB1. 'pause_flags' and 'processor' must be checked /after/ update of
      * pending flag. These values may fluctuate (after all, we hold no
      * locks) but the key insight is that each change will cause
      * evtchn_upcall_pending to be polled.
index 39bb8031caef161b9f2bead77fa7cc26c6f764a8..10353e01e948be987eb20e2ebc16c7baae86f712 100644 (file)
@@ -59,11 +59,11 @@ void notify_via_xen_event_channel(int lport);
     do {                                                                \
         if ( condition )                                                \
             break;                                                      \
-        set_bit(_VCPUF_blocked_in_xen, &current->vcpu_flags);           \
+        set_bit(_VPF_blocked_in_xen, &current->pause_flags);            \
         mb(); /* set blocked status /then/ re-evaluate condition */     \
         if ( condition )                                                \
         {                                                               \
-            clear_bit(_VCPUF_blocked_in_xen, &current->vcpu_flags);     \
+            clear_bit(_VPF_blocked_in_xen, &current->pause_flags);      \
             break;                                                      \
         }                                                               \
         raise_softirq(SCHEDULE_SOFTIRQ);                                \
@@ -72,7 +72,7 @@ void notify_via_xen_event_channel(int lport);
 
 #define prepare_wait_on_xen_event_channel(port)                         \
     do {                                                                \
-        set_bit(_VCPUF_blocked_in_xen, &current->vcpu_flags);           \
+        set_bit(_VPF_blocked_in_xen, &current->pause_flags);            \
         raise_softirq(SCHEDULE_SOFTIRQ);                                \
         mb(); /* set blocked status /then/ caller does his work */      \
     } while ( 0 )
index 1484c34f68ecbd1e03e2527de9ecda428857b439..20c0a8f9c9f334246206296f0138ae02a2a67252 100644 (file)
@@ -115,8 +115,7 @@ struct vcpu
     /* Avoid NMI reentry by allowing NMIs to be masked for short periods. */
     bool_t           nmi_masked;
 
-    unsigned long    vcpu_flags;
-
+    unsigned long    pause_flags;
     atomic_t         pause_count;
 
     u16              virq_to_evtchn[NR_VIRQS];
@@ -434,26 +433,26 @@ extern struct domain *domain_list;
        (_v) = (_v)->next_in_list )
 
 /*
- * Per-VCPU flags (vcpu_flags).
+ * Per-VCPU pause flags.
  */
  /* Domain is blocked waiting for an event. */
-#define _VCPUF_blocked         0
-#define VCPUF_blocked          (1UL<<_VCPUF_blocked)
+#define _VPF_blocked         0
+#define VPF_blocked          (1UL<<_VPF_blocked)
  /* VCPU is offline. */
-#define _VCPUF_down            1
-#define VCPUF_down             (1UL<<_VCPUF_down)
+#define _VPF_down            1
+#define VPF_down             (1UL<<_VPF_down)
  /* VCPU is blocked awaiting an event to be consumed by Xen. */
-#define _VCPUF_blocked_in_xen  2
-#define VCPUF_blocked_in_xen   (1UL<<_VCPUF_blocked_in_xen)
+#define _VPF_blocked_in_xen  2
+#define VPF_blocked_in_xen   (1UL<<_VPF_blocked_in_xen)
  /* VCPU affinity has changed: migrating to a new CPU. */
-#define _VCPUF_migrating       3
-#define VCPUF_migrating        (1UL<<_VCPUF_migrating)
+#define _VPF_migrating       3
+#define VPF_migrating        (1UL<<_VPF_migrating)
 
 static inline int vcpu_runnable(struct vcpu *v)
 {
-    return (!v->vcpu_flags &&
-            !atomic_read(&v->pause_count) &&
-            !atomic_read(&v->domain->pause_count));
+    return !(v->pause_flags |
+             atomic_read(&v->pause_count) |
+             atomic_read(&v->domain->pause_count));
 }
 
 void vcpu_pause(struct vcpu *v);
@@ -472,7 +471,7 @@ void vcpu_runstate_get(struct vcpu *v, struct vcpu_runstate_info *runstate);
 
 static inline void vcpu_unblock(struct vcpu *v)
 {
-    if ( test_and_clear_bit(_VCPUF_blocked, &v->vcpu_flags) )
+    if ( test_and_clear_bit(_VPF_blocked, &v->pause_flags) )
         vcpu_wake(v);
 }